<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h1 ref='h1qqq'>{{name}}</h1>
        <ul>
          <li ref='li' v-for='item in ary'>{{item}}</li>
        </ul>
    </div>
</body>
</html>
<script src="../../node_modules/vue/dist/vue.js"></script>
<script>
    let vm = new Vue({
        el:'#app',
        data:{
            name:"珠峰",
            ary:[1,2,3,4,5,6]
        },
        mounted() {
          // 在 Vue中 我们一般通过 this.$refs 获取对应的DOM元素或者组件
          this.ary.pop();
          // this.ary.push(234);
          // DOM 的更新是一个异步操作；为啥要做成异步？ 为了提高渲染的效率
          console.log(this.$refs.li.length)
          this.$nextTick(()=>{
            // 等待DOM更新完成之后再去触发这里的回调函数
            console.log(this.$refs.li.length)
          })
        },
    });
</script>